<?php
	$connection = mysql_connect("localhost", "root", "zxt@ljj");
	mysql_select_db("light_blogs", $connection);

	$blog_name = $_POST['blog_name'];

	$is_conflict = false;
	$blog_names = mysql_query("select blog_name from blogs");
	while($row = mysql_fetch_array($blog_names)) {
		if($blog_name == $row['blog_name']) {
			$is_conflict = true;
			break;
		}
	}

	if($is_conflict) {
		echo 1;
	} else {
		echo 0;
	}
?>